#
# build example and install to prefix/bin directory if needed
#

unset(COMPONENT_LIBRARY)
if(${BUILD_SHARED_LIBS} STREQUAL "ON")
    set(COMPONENT_LIBRARY ${COMPONENT_NAME})
else()
    set(COMPONENT_LIBRARY ${COMPONENT_NAME}_static)
endif()

add_executable(utlist list.c)
install(FILES list.c DESTINATION example/${PROJECT_NAME})

add_executable(utstack stack.c)
install(FILES stack.c DESTINATION example/${PROJECT_NAME})

add_executable(array_int array_int.c)
install(FILES array_int.c DESTINATION example/${PROJECT_NAME})

add_executable(array_long array_long.c)
install(FILES array_long.c DESTINATION example/${PROJECT_NAME})

add_executable(array_string array_string.c)
install(FILES array_string.c DESTINATION example/${PROJECT_NAME})

add_executable(array_struct array_struct.c)
install(FILES array_struct.c DESTINATION example/${PROJECT_NAME})

add_executable(hash_int hash_int.c)
install(FILES hash_int.c DESTINATION example/${PROJECT_NAME})

add_executable(hash_string hash_string.c)
install(FILES hash_string.c DESTINATION example/${PROJECT_NAME})

add_executable(hash_struct hash_struct.c)
install(FILES hash_struct.c DESTINATION example/${PROJECT_NAME})

add_executable(hash_keyptr hash_keyptr.c)
install(FILES hash_keyptr.c DESTINATION example/${PROJECT_NAME})

add_executable(hash_pointer hash_pointer.c)
install(FILES hash_pointer.c DESTINATION example/${PROJECT_NAME})

add_executable(hash_multilevel hash_multilevel.c)
install(FILES hash_multilevel.c DESTINATION example/${PROJECT_NAME})

add_executable(hash_compound_keys hash_compound_keys.c)
install(FILES hash_compound_keys.c DESTINATION example/${PROJECT_NAME})

add_executable(string_printf string_printf.c)
install(FILES string_printf.c DESTINATION example/${PROJECT_NAME})

add_executable(string_bincpy string_bincpy.c)
install(FILES string_bincpy.c DESTINATION example/${PROJECT_NAME})

add_executable(string_concat string_concat.c)
install(FILES string_concat.c DESTINATION example/${PROJECT_NAME})

add_executable(ringbuffer_int ringbuffer_int.c)
install(FILES ringbuffer_int.c DESTINATION example/${PROJECT_NAME})

add_executable(ringbuffer_long ringbuffer_long.c)
install(FILES ringbuffer_long.c DESTINATION example/${PROJECT_NAME})

add_executable(ringbuffer_string ringbuffer_string.c)
install(FILES ringbuffer_string.c DESTINATION example/${PROJECT_NAME})

add_executable(ringbuffer_struct ringbuffer_struct.c)
install(FILES ringbuffer_struct.c DESTINATION example/${PROJECT_NAME})
